/**
 * $Id: Print.java 4 2010-09-10 17:02:31Z tanktong $
 * Copyright(C) 2010-2014 xiaonei.com/kaixin.com, All Rights Reserved.
 */
package com.tkiicpp.tank.utils.jar;

import java.util.ArrayList;
import java.util.List;




/**
 * @author <a href="mailto:kun.tong@opi-corp.com">Tank.Tong</a>
 * @version 1.0 2010-08-20 14:19:55
 * @since 1.0
 */
public class Print {

    /**
     * @param args
     */
    public static void main(String[] args) {
//        for (int i = 0; i < 90; i++) {
//            System.out.println("public String a" + i + " = \"" + i + "\";");
//        }
//        List<Integer> list = new ArrayList<Integer>();
//        Map<String, String> map = new HashMap<String, String>();
//        Enumeration<Integer> enumeration = new Hashtable(map).elements();
//        for (int i = 0; i < 10; i++) {
//            new Test(i).run();
//        }
//
//        List<Integer> a = new ArrayList<Integer>();
//        System.out.println(a.get(3));

//        String a = "a";
//        String b = a + "b";
//        String c = "ab";
//
//        System.out.println(b == c);
//
//        String d = a.concat("b");
//        System.out.println(d == b);
//        System.out.println(d == c);
//
//        System.out.printf("%s-%s-%s-%s", a, b, c, d);
//        new Child();
//        int[] a = new int[1];
//        long [] b = new long[1];
////        b = (long[]) a;
//        List<String> s = new ArrayList<String>();
//        List<Object> o = new ArrayList<Object>();
//        s = (List<String>) o;
        List<Integer> list = new ArrayList<Integer>();
        for (int i = 0; i < 99; i++) {
            list.add(i);
        }

        System.out.println(findMiddle(list));

    }

    private static int findMiddle(List<Integer> list) {
        int first = 0;
        int second = 0;

        while (true) {
        if (second + 1 < list.size() && second + 2 < list.size()) {
            second += 2;
            first++;
        } else {
            break;
        }
        }

        return first;
    }

    private static class Test extends Thread {
        private int i;

        public Test(int i) {
            this.i = i;
        }

        @Override
        public void run() {
            System.out.println(i);
        }

    }

    private static abstract class Father {
//        protected String a = "a";

        public Father() {
            System.out.println(getStaticValue());
            System.out.println(getValue());
        }

        protected abstract String getValue();
        protected abstract String getStaticValue();
    }

    private static class Child extends Father {
        private static String a = "a";
        private String b = "b";

        public Child() {
            super();
//            System.out.println(super.a);
        }

        @Override
        protected String getValue() {
            return b;
        }

        @Override
        protected String getStaticValue() {
            return a;
        }
    }

}
